#include <bits/stdc++.h>
using namespace std;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using ll = long long;
void solve()
{
    string s;
    getline(cin, s);
    string ans;
    ans += s[0];
    for (ll i = 1; i < s.size();i++)
    {
        if(s[i]==' '){
            ans += s[i + 1];
        }
    }
    cout << ans << endl;
}
int main()
{
    int t = 1;
    cin >> t;
    getchar();
    while(t--)
    {
        solve();
    }
   return 0;
}
